<div class="visit-theme page-content ">
	<form nz-form [formGroup]="validateForm" class="page-header">
		<div nz-row [nzGutter]="24">
			<div nz-col [nzSpan]="6">
				<nz-form-item>
					<nz-form-label nzFor="status">状态</nz-form-label>
					<nz-form-control>
						<!-- <input nz-input placeholder="请填写" formControlName="status" /> -->
						<nz-select formControlName="status" nzPlaceHolder="请选择" nzAllowClear>
							<nz-option nzLabel="未读" nzValue="0"></nz-option>
							<nz-option nzLabel="已读" nzValue="1"></nz-option>
						</nz-select>

					</nz-form-control>
				</nz-form-item>
			</div>
			<div nz-col [nzSpan]="6">
				<nz-form-item>
					<nz-form-label nzFor="type">类型</nz-form-label>
					<nz-form-control>
						<!-- 1爆料2走访 -->
						<nz-select formControlName="type" nzPlaceHolder="请选择" nzAllowClear>
							<nz-option nzLabel="爆料" nzValue="1"></nz-option>
							<nz-option nzLabel="走访 " nzValue="2"></nz-option>
						</nz-select>

					</nz-form-control>
				</nz-form-item>
			</div>
			<div nz-col [nzSpan]="6" [nzOffset]="6">
				<nz-form-item style="float: right;">
					<button nz-button *ngIf="authList.includes(authEnum.NOTICE_VIEW)" (click)="onSearch(true)">
						<i nz-icon nzType="search"></i>
						搜索
					</button>

				</nz-form-item>
			</div>
		</div>

	</form>


	<nz-table #basicTable [nzData]="data" [nzBordered]="true" [nzShowPagination]="false" nzSize="middle"
		[nzScroll]="{y: 'calc(100vh - 190px)'}" [nzLoading]="nzLoading" [nzPageSize]="page.limit">
		<thead>
			<tr>
				<th nzAlign="center" nzWidth="100px">序号</th>
				<th nzAlign="center" nzWidth="auto">消息标题</th>
				<th nzAlign="center" nzWidth="auto">发送时间</th>
				<th nzAlign="center" nzWidth="150px">消息状态</th>
				<th nzAlign="center" nzWidth="150px">消息类型</th>
				<th nzAlign="center" nzWidth="250px">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr *ngFor="let item of basicTable.data; let i = index;">
				<td nzAlign="center">{{ i + 1}}</td>
				<td nzAlign="center">
					{{item.title}}
				</td>
				<td nzAlign="center">
					{{item.createTime}}
				</td>
				<td nzAlign="center">
					<ng-container *ngIf="item.status * 1 === 0">
						<nz-badge nzStatus="default" nzText="未读"></nz-badge>
					</ng-container>
					<ng-container *ngIf="item.status * 1 === 1">
						<nz-badge nzStatus="processing" nzText="已读"></nz-badge>
					</ng-container>
				</td>
				<td nzAlign="center">
					<ng-container *ngIf="item.type * 1 === 1">
						<!-- <nz-badge nzStatus="default" nzText="未读"></nz-badge> -->
						<nz-tag [nzColor]="'#2db7f5'">爆料</nz-tag>
					</ng-container>
					<ng-container *ngIf="item.type * 1 === 2">
						<!-- <nz-badge nzStatus="processing" nzText="已读"></nz-badge> -->
						<nz-tag [nzColor]="'#87d068'">走访</nz-tag>

					</ng-container>
				</td>
				<td nzAlign="center">
					<div class="menu-btn">
						<ng-container *ngIf="authList.includes(authEnum.NOTICE_UPDATE)">
							<ng-container *ngIf="item.status * 1 === 0">
								<a nz-popconfirm nzPopconfirmTitle="确定已读吗?" (nzOnConfirm)="update(item)">已读</a>
								<nz-divider nzType="vertical"></nz-divider>
							</ng-container>
						</ng-container>
						<!-- <nz-divider
							*ngIf="item.status * 1 === 0 && authList.includes(authEnum.NOTICE_UPDATE) && authList.includes(authEnum.NOTICE_DEL)"
							nzType="vertical"></nz-divider> -->
						<ng-container *ngIf="authList.includes(authEnum.NOTICE_DEL)">
							<a nz-popconfirm nzPopconfirmTitle="确定删除吗?" (nzOnConfirm)="del(item)">删除</a>
							<nz-divider nzType="vertical"></nz-divider>
						</ng-container>
						<ng-container *ngIf="item.type * 1 === 1">
							<a [routerLink]="'/page/disclose/disclose-list'">处理</a>
						</ng-container>
						<ng-container *ngIf="item.type * 1 === 2">
							<a [routerLink]="'/page/visit/visit-record/1'">处理</a>
						</ng-container>
					</div>
				</td>
			</tr>
		</tbody>
	</nz-table>

	<div class="page-pagination">
		<span *ngIf="page.total">共{{page.total}}条数据</span>
		<nz-pagination [(nzPageIndex)]="page.page" [nzTotal]="page.total" nzShowQuickJumper nzShowSizeChanger
			[(nzPageSize)]="page.limit" (nzPageIndexChange)="onSearch()" (nzPageSizeChange)="onSearch(true)">
		</nz-pagination>
	</div>

</div>